<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
<!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
<!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
<!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<%@page import="components.GlobalConstants"%>
<html lang="en" class="no-js">
<!--<![endif]-->
<%@page import="aiball.ContentService"%>
<%
    def contentserv = grailsApplication.classLoader.loadClass('aiball.ContentService').newInstance()
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta property="fb:admins" content="100003780394663" />
<title><g:layoutTitle default="JavaKicker" /></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon"
	href="${resource(dir: 'images', file: 'favicon.ico')}"
	type="image/x-icon">
<link rel="apple-touch-icon"
	href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
<link rel="apple-touch-icon" sizes="114x114"
	href="${resource(dir: 'images', file: 'apple-touch-icon-retina.png')}">
<link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}"
	type="text/css">
<link rel="stylesheet"
	href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css">
<g:layoutHead />
<r:layoutResources />


<link rel="stylesheet"
	href="${resource(dir: 'css/jqui/custom-theme', file: 'jquery-ui-1.8.20.custom.css')}"
	type="text/css">
<script
	src="${GlobalConstants.URL_COMPLEATE}/static/plugins/jquery-1.7.1/js/jquery/jquery-1.7.1.min.js"
	type="text/javascript"></script>
<script
	src="${GlobalConstants.URL_COMPLEATE}/static/plugins/jquery-ui-1.8.15/jquery-ui/js/jquery-ui-1.8.15.custom.min.js"
	type="text/javascript"></script>



<jq:plugin name="form" />


<script type="text/javascript"
	src="http://social-extension.abouttheweb.de/external/jquery.ba-postmessage.js"></script>
<script type="text/javascript"
	src="http://social-extension.abouttheweb.de/external/abouttheweb-fb-feed.js"></script>


<link rel="stylesheet" href="${resource(dir: 'css/jqui/custom-theme', file: 'jquery-ui-1.8.20.custom.css')}" type="text/css">
<script type="text/javascript">


function showGameOfTheDay()
{
	
	
	$('#gotdd').html('<iframe src="http://javakicker.de:8080/web1/javakicker/viewdata/gotd.html" style="border:0px #FFFFFF none;" name="gameiframe" scrolling="no" frameborder="0" align=aus marginheight="0px" marginwidth="0px" height="768" width="1200"></iframe>');
	$('#gotdd').dialog({
		show: "fade",
		hide: "puff",
		modal: true,
		title: "Show Game",
		resizable: false,
		minWidth: 1240,
		minHeight: 768
		
	});

	$( "#gotdd" ).bind( "dialogbeforeclose", function(event, ui) {
		$('#gotdd').html('none');
		});
	
}

</script>


<script>
	function cldialog(data) {

		$('#pwvergessen').dialog("close");

		$('#email').val('');

		$("#ausgabe").dialog({
			modal : true,
			buttons : {
				Ok : function() {
					$(this).dialog("close");
				}
			}
		});

	}

	$(document).ready(function() {

		$('#atwLink').empty();

		var options = {
			target : '#ausgabe', // target element(s) to be updated with server response 
			//beforeSubmit:  clearText,  // pre-submit callback 
			success : cldialog
		// post-submit callback 

		// other available options: 
		//url:       url         // override for form's 'action' attribute 
		//type:      type        // 'get' or 'post', override for form's 'method' attribute 
		//dataType:  null        // 'xml', 'script', or 'json' (expected server response type) 
		//clearForm: true        // clear all form fields after successful submit 
		//resetForm: true        // reset the form after successful submit 

		// $.ajax options can be used here too, for example: 
		//timeout:   3000 
		};
		$('#pwverform').ajaxForm(options);

		$.get('contents/info', function(data) {
			$('#erstemal').html(data);
		});

		$.get('playerStats/calculatePortalStats', function(data) {
			$('#stats').html(data);
		});

		$.get('history/PortalBundesliga', function(data) {
			$('#ligauebersicht').html(data);
			$('#verlaengerung').height($('#ligauebersicht').height());
		});

		$.get('/userAccount/menuControlPanel', function(data) {
			$('#usercp').html(data);
		});

	});

	function pwForgot() {

		$('#pwvergessen').dialog({
			show : "fade",
			hide : "puff",
			resizable : false,
			minWidth : 430,
			minHeight : 150

		});

	}
</script>



</head>
<body>

	<div id="mainNavi" role="navigation">
		<ul>
			<a href="/"><h4>Home</h4></a>
		</ul>
		<ul>
			<li><g:link controller="history" action="zeigeBundesliga">
					<h4>Liga</h4>
				</g:link></li>
			<!-- <li>
					<h4>Liga</h4>
					<ul class="subPoint">
						<li><g:link controller="history" action="zeigeBundesliga">
								<h4>Hauptliga</h4>
							</g:link></li>
						<li><g:link controller="league" action="verwaltung">
								<h4>Andere Ligen</h4>
							</g:link></li>
					</ul>
				</li>-->
		</ul>


		${contentserv.getContentLinks()}


		<!-- <ul>
				<a href='http://www.emailmeform.com/builder/form/9Me5ap2fqjHe9UP0uRNnl825' title='Bug Report' target='_blank'>Bug Report</a>
			</ul>-->
		<sec:ifLoggedIn>

			<ul>
				<li><g:link controller="userAccount">
						<h4>
							<sec:username />
						</h4>
					</g:link>
					<ul>
						<li
							style="width: 300px; padding-left: 5px; padding-right: 5px; text-align: right;">
							<div id="usercp"></div>
						</li>
					</ul></li>
			</ul>
		</sec:ifLoggedIn>

		<sec:ifNotLoggedIn>
			<ul>
				<li><g:link controller="login" action="auth">
						<h4>Login</h4>
					</g:link>
					<ul class="loginPoint">
						<li
							style="width: 350px; padding-left: 5px; padding-right: 5px; text-align: right;">

							<form action='/AIBall/j_spring_security_check' method='POST'
								id='loginForm' class='cssform' autocomplete='off'>
								<label for="username"><g:message
										code="springSecurity.login.username.label" />:</label> <input
									type="text" class="text_" name="j_username" id="username"
									style="margin-bottom: 5px;" /> <br> <label for="password"><g:message
										code="springSecurity.login.password.label" />:</label> <input
									style="margin-right: 6px; margin-bottom: 2px;" type="password"
									class="text_" name="j_password" id="password" /><br> <input
									style="margin-right: 6px; margin-bottom: 2px;" type='checkbox'
									class='chk' name='${rememberMeParameter}' id='remember_me'
									<g:if test='${hasCookie}'>checked='checked'</g:if> /> <label
									style="margin-right: 6px; margin-bottom: 2px;"
									for='remember_me'><g:message
										code="springSecurity.login.remember.me.label" /></label><br>

								<button style="margin-right: 6px;" type="submit" value="Login">Login</button>
								<a href="#" onclick="pwForgot();">Passwort vergessen?</a>

							</form>

						</li>
					</ul></li>
			</ul>

			<ul>
				<g:link controller="userAccount" action="create"
					params="[reg: 'Registrieren']">
					<h4>Registrieren</h4>
				</g:link>
			</ul>
		</sec:ifNotLoggedIn>
	</div>

	<div id="ausgabe"></div>

	<div id="pwvergessen" style="display: none;">

		<g:form id="pwverform" controller="login" action="forgottenPW">
			<label for="email"> <g:message code="userAccount.email.label"
					default="Email" /> <span class="required-indicator">*</span>
			</label>
			<g:field type="email" name="email" required=""
				value="${userAccountInstance?.email}" />

			<g:submitButton name="submit" class="forgottenPW"
				value="${message(code: 'default.button.forgotten.label', default: 'Submit')}" />

		</g:form>

	</div>
	<div>
	<div id="logo" role="banner">
		<a href="http://www.javakicker.de"><img
			src="${resource(dir: 'images', file: 'javakicker_logo.png')}"
			alt="Grails" /></a><a class="button white gameofthedaybutton" style="color:black;text-decoration:none;" href="#" onclick="showGameOfTheDay()" >Spiel des Tages</a>
	</div>
	
	</div>
	<g:layoutBody />
	<div class="footer" role="contentinfo"></div>
	<div id="spinner" class="spinner" style="display: none;">
		<g:message code="spinner.alt" default="Loading&hellip;" />
	</div>
	<g:javascript library="application" />
	<r:layoutResources />
	<div id="gotdd" ></div>
</body>
</html>